package client;

import common.Item;

public class OutbidStrategy implements Strategy {
	
	private Item item;
	private double maxBid;
	
	public OutbidStrategy(Item item, double maxBid) {
		this.item = item;
		this.maxBid = maxBid;
	}

	@Override
	public void bid(String currentBidder) {
		double currentBid = item.getCurrentBid();
		if(item.getCurrentBidder() != currentBidder) {
			if(currentBid < maxBid) {
				item.setCurrentBid(currentBid + 1.00);
				item.setCurrentBidder(currentBidder);
			}
		}
	}

}
